import "normalize.css";
import "@/assets/styles/index.scss"; // global css

import "babel-polyfill";
import Vue from "vue";
import store from "./store";
import App from "./App";
import router from "./router";
import i18n from "./locale";
import axios from "./api/axios";

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

import "@/icons";
import "./permission";

Vue.config.productionTip = false;

// axios
Object.defineProperties(Vue.prototype, {
  $axios: {
    get: () => axios
  }
});

// eventbus
const EventBus = new Vue();
// Add to Vue properties by exposing a getter for $bus
Object.defineProperties(Vue.prototype, {
  $bus: {
    get: () => EventBus
  }
});

Vue.use(ElementUI, {
  size: "medium",
  i18n: (key, value) => i18n.t(key, value)
});

/* eslint-disable no-new */
new Vue({
  i18n,
  store,
  router,
  render: h => h(App)
}).$mount("#app");
